package com.yuzhihao.writejvm.format;

/**
 * Method Type and Method Handle Resolution
 *
 * @author yzh
 * @see <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html#jvms-5.4.3.5">
 *     方法类型</a>
 * @since 2021年12月01日19:25:10
 */
public enum MethodTypeResolutionEnum {

    //
    REF_getField(1, "getfield","REF_getField","getfield C.f:T"),
    REF_getStatic(2, "getstatic","REF_getStatic","getstatic C.f:T"),
    REF_putField(3,"putfield","REF_putField","putfield C.f:T"),
    REF_putStatic(4, "putstatic","REF_putStatic","putstatic C.f:T"),
    REF_invokeVirtual(5, "invokevirtual","REF_invokeVirtual","invokevirtual C.m:(A*)T"),
    REF_invokeStatic(6, "invokestatic","REF_invokeStatic","invokestatic C.m:(A*)T"),
    REF_invokeSpecial(7, "invokespecial","REF_invokeSpecial","invokespecial C.m:(A*)T"),
    REF_newInvokeSpecial(8, "newinvokespecial","REF_newInvokeSpecial","new C; dup; invokespecial C.<init>:(A*)V"),
    REF_invokeInterface(9, "invokeinterface","REF_invokeInterface","invokeinterface C.m:(A*)T"),
    ;

    private final int value;
    private final String desc;
    private final String description;
    private final String interpretation;

    MethodTypeResolutionEnum(int value, String desc, String description, String interpretation) {
        this.value = value;
        this.desc = desc;
        this.description = description;
        this.interpretation = interpretation;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public String getDescription() {
        return description;
    }

    public String getInterpretation() {
        return interpretation;
    }
}
